﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Decoration.Models.Models
{
    public class OrderInfo
    {
        [Key]
        public int Id { get; set; }

        /// <summary>
        /// 业务类型
        /// </summary>
        public int BusinessId { get; set; }

        /// <summary>
        /// 订单类型
        /// </summary>
        public int OrderType { get; set; }

        /// <summary>
        /// 创建人
        /// </summary>
        public int Creater { get; set; }


        /// <summary>
        /// 所属客户
        /// </summary>
        public int Customer { get; set; }

        [MaxLength(50)]
        public string CustomerName { get; set; } = null!;

        /// <summary>
        /// 总金额
        /// </summary>
        [Column(TypeName = "decimal(18,2)")]
        public decimal OrderTotal { get; set; }

        public string? OrderPict { get; set; }

        /// <summary>
        /// 审批状态
        /// </summary>
        public int ApprovalStatus { get; set; } = 1;

        /// <summary>
        /// 项目状态
        /// </summary>
        public int ProjectStatus { get; set; } = 0;

        public int Status { get; set; } = 1;

        public DateTime CreateTime { get; set; } = DateTime.Now;

        public virtual ICollection<OrderDetail> OrderDetails { get; set; } = new List<OrderDetail>();

        public virtual ProjectInfo? ProjectInfo { get; set; }
    }
}
